package cubelabs.nexus.dao;

import java.util.Collection;
import java.util.List;

import org.hibernate.criterion.Restrictions;
import org.springframework.stereotype.Repository;

import cubelabs.nexus.entity.Bid;
import cubelabs.nexus.entity.SkillClassified;

@Repository("bidDAO")
public class BidDAO extends BaseDAO<Bid, Long>{

	public List<Bid> findBidsByClassified(long classifiedId) {
		return findByCriteria(Restrictions.eq("skillClassified.id", classifiedId));
	}
	
	public List<Bid> findBidsByUser(long userId) {
		return findByCriteria(Restrictions.eq("user.id", userId));
	}

	public Collection<? extends Bid> findBidsByClassified(SkillClassified classified) {
		return findByCriteria(Restrictions.eq("skillClassified", classified));
	}
	
}
